package org.example.controller;

import org.example.pojo.User;
import org.example.service.UserSerivce;
import org.example.service.UserSerivceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * ClassName: UserController
 * Package: org.example.controller
 * Description:
 *
 * @Author liu
 * @Create 2025/5/17 20:16
 * @ Version 1.0
 */

@RestController
    public class UserController {

        @Autowired
        private UserSerivce userService;

        @RequestMapping("/list")
        public List<User> list(){
            //1.调用Service
            List<User> userList = userService.findAll();
            //2.响应数据
            return userList;
        }
}
